home *** CD-ROM | disk | FTP | other *** search
- global gInterfaceSprite, gPictSprite, gZoomFactor, gZoomFactors, gZoomLevels, gZoomDirection, gSpriteHeight, gSpriteWidth, gSpriteHeightPercent, gSpriteWidthPercent, gDistance, gDistanceH, gDistanceV
-
- on setDimensions
- if the type of sprite gPictSprite > 0 then
- set whichCast to the castNum of sprite gPictSprite
- if the castType of cast whichCast = #bitmap then
- set gSpriteHeight to the height of sprite gPictSprite * 1.0 / 2
- set gSpriteWidth to the width of sprite gPictSprite * 1.0 / 2
- set gSpriteHeightPercent to the height of sprite gPictSprite * 1.0 / the height of cast whichCast
- set gSpriteWidthPercent to the width of sprite gPictSprite * 1.0 / the width of cast whichCast
- set gDistanceH to gDistance * gSpriteHeightPercent
- set gDistanceV to gDistance * gSpriteWidthPercent
- end if
- end if
- set the cursor of sprite gInterfaceSprite to -1
- end
-
- on checkImage userH, userV
- if userV < the top of sprite gInterfaceSprite then
- set PICThModifier to ((userH < 20) - (userH > 620)) * gDistanceH
- set PICTvModifier to ((userV < 20) - (userV > (the top of sprite gInterfaceSprite - 20))) * gDistanceV
- set newH to checkRange(the locH of sprite gPictSprite + PICThModifier, gSpriteWidth, 640 - gSpriteWidth)
- set newV to checkRange(the locV of sprite gPictSprite + PICTvModifier, gSpriteHeight, the top of sprite gInterfaceSprite - gSpriteHeight)
- set the locH of sprite gPictSprite to newH
- set the locV of sprite gPictSprite to newV
- updateStage()
- set PICThModifier to PICThModifier / gDistanceH * 10
- set PICTvModifier to PICTvModifier / gDistanceV * 10
- set newCursor to "Cursor " & integer(PICThModifier) & "," & integer(PICTvModifier)
- if the optionDown then
- if newCursor = "Cursor 0,0" then
- set newCursor to "Cursor 1,1"
- end if
- end if
- set whichCast to the number of cast newCursor
- if whichCast > 0 then
- set whichMaskCast to the number of cast (newCursor & " Mask")
- set the cursor of sprite 1 to [whichCast, whichMaskCast]
- cursor([whichCast, whichMaskCast])
- end if
- end if
- puppetSprite(gPictSprite, 1)
- go(the frame)
- end
-
- on checkImage1 userH, userV
- if userV < the top of sprite gInterfaceSprite then
- set spriteWidth to the width of sprite gPictSprite
- set spriteHeight to the height of sprite gPictSprite
- set PICThModifier to ((userH < 20) - (userH > 620)) * gDistanceH
- set PICTvModifier to ((userV < 20) - (userV > (the top of sprite gInterfaceSprite - 20))) * gDistanceV
- set newH to checkRange(the locH of sprite gPictSprite + PICThModifier, gSpriteWidth, 640 - gSpriteWidth)
- set newV to checkRange(the locV of sprite gPictSprite + PICTvModifier, gSpriteHeight, the top of sprite gInterfaceSprite - gSpriteHeight)
- set the locH of sprite gPictSprite to newH
- set the locV of sprite gPictSprite to newV
- updateStage()
- set PICThModifier to PICThModifier / gDistanceH * 10
- set PICTvModifier to PICTvModifier / gDistanceV * 10
- set newCursor to "ArrowCursor " & integer(PICThModifier) & "," & integer(PICTvModifier)
- set the cursor of sprite 1 to [the number of cast newCursor, the number of cast (newCursor & " Mask")]
- cursor([the number of cast newCursor, the number of cast (newCursor & " Mask")])
- end if
- puppetSprite(gPictSprite, 1)
- go(the frame - 1)
- end
-
- on checkImage2 userH, userV
- if userV < the top of sprite gInterfaceSprite then
- set PICThModifier to ((userH < 20) - (userH > 620)) * gDistanceH
- set PICTvModifier to ((userV < 20) - (userV > (the top of sprite gInterfaceSprite - 20))) * gDistanceV
- set newH to checkRange(the locH of sprite gPictSprite + PICThModifier, gSpriteWidth, 640 - gSpriteWidth)
- set newV to checkRange(the locV of sprite gPictSprite + PICTvModifier, gSpriteHeight, the top of sprite gInterfaceSprite - gSpriteHeight)
- set oldH to the locH of sprite gPictSprite
- set oldV to the locV of sprite gPictSprite
- updateDart(gPictSprite, 0, oldH, oldV, newH, newV, 1.79999999999999982)
- updateDart(gPictSprite, 0, oldH, oldV, newH, newV, 1.59999999999999987)
- updateDart(gPictSprite, 0, oldH, oldV, newH, newV, 1.39999999999999991)
- updateDart(gPictSprite, 0, oldH, oldV, newH, newV, 1.19999999999999996)
- updateDart(gPictSprite, 0, oldH, oldV, newH, newV, 1.0)
- set PICThModifier to PICThModifier / gDistanceH * 10
- set PICTvModifier to PICTvModifier / gDistanceV * 10
- set newCursor to "ArrowCursor " & integer(PICThModifier) & "," & integer(PICTvModifier)
- set the cursor of sprite 1 to [the number of cast newCursor, the number of cast (newCursor & " Mask")]
- cursor([the number of cast newCursor, the number of cast (newCursor & " Mask")])
- end if
- puppetSprite(gPictSprite, 1)
- go(the frame - 1)
- end
-
- on zoomSprite whichSprite, userClickLoc, centerH, centerV, zoomDirection
- if the type of sprite whichSprite = 0 then
- exit
- end if
- set gZoomDirection to zoomDirection
- set tryZoomFactor to gZoomFactor + zoomDirection
- if (tryZoomFactor < 1) or (tryZoomFactor > gZoomLevels) then
- beep()
- exit
- end if
- set gZoomFactor to tryZoomFactor
- set whichZoomFactor to getAt(gZoomFactors, gZoomFactor)
- set whichCast to the castNum of sprite gPictSprite
- if the castType of cast whichCast = #bitmap then
- set gSpriteHeightPercent to the height of sprite gPictSprite * 1.0 / the height of cast whichCast
- set gSpriteWidthPercent to the width of sprite gPictSprite * 1.0 / the width of cast whichCast
- set gSpriteHeight to the height of cast whichCast * whichZoomFactor * 1.0 / 2
- set gSpriteWidth to the width of cast whichCast * whichZoomFactor * 1.0 / 2
- set centerLoc to point(centerH, centerV)
- set zoomLoc to centerLoc - userClickLoc
- set newH to centerH + (getAt(zoomLoc, 1) * 1.0 / gSpriteWidthPercent * whichZoomFactor)
- set newV to centerV + (getAt(zoomLoc, 2) * 1.0 / gSpriteHeightPercent * whichZoomFactor)
- set newH to checkRange(newH, gSpriteWidth, 640 - gSpriteWidth)
- set newV to checkRange(newV, gSpriteHeight, the top of sprite gInterfaceSprite - gSpriteHeight)
- puppetSprite(whichSprite, 1)
- spriteBox(whichSprite, newH - gSpriteWidth, newV - gSpriteHeight, newH + gSpriteWidth, newV + gSpriteHeight)
- end if
- go(the frame)
- setDimensions()
- checkImage(the mouseH, the mouseV)
- end
-
- on zoomPICT whichSprite, userClickLoc, centerH, centerV
- if the type of sprite whichSprite = 0 then
- exit
- end if
- set the stretch of sprite whichSprite to not (the stretch of sprite whichSprite)
- if the stretch of sprite whichSprite = 1 then
- set magnificationFactor to 2
- set whichCast to the castNum of sprite whichSprite
- set newHeight to the height of cast whichCast / (magnificationFactor * 2)
- set newWidth to the width of cast whichCast / (magnificationFactor * 2)
- spriteBox(whichSprite, centerH - newWidth, centerV - newHeight, centerH + newWidth, centerV + newHeight)
- else
- set centerLoc to point(centerH, centerV)
- set zoomLoc to stripPoint(centerLoc - userClickLoc)
- set the locH of sprite whichSprite to centerH + value(item 1 of zoomLoc)
- set the locV of sprite whichSprite to centerV + value(item 2 of zoomLoc)
- end if
- updateStage()
- end
-
- on zoomPICTtoCenterHV whichSprite, userClickLoc, centerH, centerV
- if the type of sprite whichSprite = 0 then
- exit
- end if
- set the stretch of sprite whichSprite to not (the stretch of sprite whichSprite)
- set magnificationFactor to 2
- if the stretch of sprite whichSprite = 1 then
- set whichCast to the castNum of sprite whichSprite
- set newHeight to the height of cast whichCast / (magnificationFactor * 2)
- set newWidth to the width of cast whichCast / (magnificationFactor * 2)
- spriteBox(whichSprite, centerH - newWidth, centerV - newHeight, centerH + newWidth, centerV + newHeight)
- else
- set centerLoc to point(centerH, centerV)
- set zoomLoc to stripPoint(userClickLoc - centerLoc)
- set the locH of sprite whichSprite to centerH - (value(item 1 of zoomLoc) * magnificationFactor)
- set the locV of sprite whichSprite to centerV - (value(item 2 of zoomLoc) * magnificationFactor)
- end if
- updateStage()
- end
-
- on getMagnificationFactor whichSprite, heightOrWidth
- set whichCast to the castNum of sprite whichSprite
- if heightOrWidth = 0 then
- set castHeight to the height of cast whichCast
- set spriteHeight to the height of cast whichCast
- return 1.0 * castHeight / spriteHeight
- else
- set castWidth to the width of cast whichCast
- set spriteWidth to the width of cast whichCast
- return 1.0 * castWidth / spriteWidth
- end if
- end
-